package com.redoor.app.stake;

import com.taobao.pandora.boot.PandoraBootstrap;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * Created by wangjunlei on 2018/1/23.
 */
@SpringBootApplication
@ComponentScan({"com.redoornetwork.framework", "com.redoor.app.stake.*"})
@EnableTransactionManagement(order = 10)
@ImportResource(locations="classpath:hsf-consumer-beans.xml")
public class RunApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(RunApplication.class);
    }

    public static void main(String[] args) {
        PandoraBootstrap.run(args);
        SpringApplication.run(RunApplication.class, args);
        PandoraBootstrap.markStartupAndWait();
    }
}
